﻿Public Class KNLuongNV
    Private dt As New Database_
    Private sql As String
    Public Function DKDSL(ByVal thang As String) As DataTable
        sql = "select l.* from LUONGTHANG l, CTTHANG c where and c.MLuong=l.MLuong and c.Thang='" & thang & "'"
        Dim data As DataTable = dt.execQuery(sql)
        Return data
    End Function
    Public Function DSL() As DataTable
        sql = "select l.* from LUONGTHANG l"
        Dim data As DataTable = dt.execQuery(sql)
        Return data
    End Function
  
    Public Function ALL_DSL(ByVal thang As String) As DataTable
        sql = "select n.MaNV,n.HoTen,n.CVu,l.* from LUONGTHANG l, NHANVIEN n,CTTHANG c where n.MaNV=c.MaNV and c.MLuong=l.MLuong and c.Thang='" & thang & "'"
        Dim data As DataTable = dt.execQuery(sql)
        Return data
    End Function
    
    Public Function DK_DSLuong(ByVal thang As String) As DataTable
        sql = "select n.MaNV,n.HoTen,n.CVu, l.* from LUONGTHANG l,CTTHANG c ,NHANVIEN n where n.MaNV=c.MaNV and c.MLuong=l.MLuong and c.Thang='" & thang & "'"
        Dim data As DataTable = dt.execQuery(sql)
        Return data
    End Function
    Public Function SaveLuong(ByVal data As DataTable) As Boolean
        sql = "select * from LUONGTHANG "
        Return dt.ExecUpdate(sql, data)
    End Function
    Public Function SaveCTiet(ByVal data As DataTable) As Boolean
        sql = "select * from CTTHANG "
        Return dt.ExecUpdate(sql, data)
    End Function
End Class
